﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductCatalogue.aspx.cs" Inherits="University.Workshop.Web.ProductCatalogue" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body bgcolor="#99cc00">
    <center><h1><b style="background-color: #FFFFCC; color: #008000;">Catalogo de Nuetros Productos</b></h1></center>
    
    <form id="form1" runat="server">
    <div>
    <br />
    <center> Tipo de Productos Ofrecidos: 
        
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
            DataSourceID="SqlDataSource2" DataTextField="Description" 
            DataValueField="Description">
        </asp:DropDownList>

        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PharmacyConnectionString %>" 
            SelectCommand="SELECT [Description] FROM [Presentation]">
        </asp:SqlDataSource>

    </center>
    <br />
    <br />    
    <center>
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="5" 
            AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" 
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            
            <Columns>
                
                <asp:BoundField DataField="Name" HeaderText="Nombre" 
                    SortExpression="Name" />
                <asp:BoundField DataField="Presentation" HeaderText="Presentacion" 
                    SortExpression="Presentation" />
                <asp:BoundField DataField="Description" HeaderText="Descripcion" 
                    SortExpression="Description" />
                <asp:ImageField DataImageUrlField="Image" DataImageUrlFormatString="~/Image/producto-{0}.jpg"
                 HeaderText="Imagen" ControlStyle-Height="200px" ControlStyle-Width="200px">
                </asp:ImageField>
            
            </Columns>
            
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />

        </asp:GridView>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PharmacyConnectionString %>" 
            
            SelectCommand="SELECT [CodeProduct], [Name], [Presentation], [Description], [Image] FROM [ProductCatalogue] WHERE ([Presentation] = @Presentation)">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="Presentation" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    </center>

    </div>
    </form>

</body>
</html>
